<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="./list.js"></script>

    <script>
        // 5.返回一个由所有图片地址属性 + 属性值的新数组
        // 例如[{ imgUrl：“https：//www.....”}   ]

        let newArr = []
        goodList.forEach(function (val, i) {
            newArr.push({
                imgUrl: val.imageUrl
            })
        })
        console.log(newArr); 

        newArr = goodList.map(function(val, i){
            return val.imageUrl
        })

        console.log(newArr);

        newArr = goodList.reduce(function(pre, cur, curIndex){
            pre.push({imgUrl: cur.imageUrl})
            return pre
        }, [])

        console.log(newArr);
    </script>
</body>

</html>